
package kaizone.haining.chaobohui.json;

import android.content.Context;
import android.text.TextUtils;
import android.widget.Toast;

public class DetailDO {

    public final static class chao {

        public final static class user {
            public final static class activity {

                public final static String follow_duplicate = "chao.user.activity.follow.duplicate";

                public final static String checkin_activity_time_ended = "chao.user.activity.checkin.activity.time.ended";

                public final static String checkin_duplicate = "chao.user.activity.checkin.duplicate";

                public final static String signup_duplicate = "chao.activity.signup.duplicate";

                public final static String checkin_location_required = "chao.user.activity.checkin.location.required";
            }

            public final static class subject {
                public final static String favorite_duplicate = "chao.user.subject.favorite.duplicate";

            }
        }
    }

    public static String promptMsg(String detail) {
        if (TextUtils.isEmpty(detail))
            return null;
        String prompt = null;
        if (detail.equals(chao.user.activity.follow_duplicate)) {
            prompt = "您已关注了该活动";
        }//
        else if (detail.equals(chao.user.activity.checkin_activity_time_ended)) {
            prompt = "签到失败,活动未开始或活动已结束";
        }//
        else if (detail.equals(chao.user.activity.checkin_duplicate)) {
            prompt = "您已签到该活动";
        }//
        else if (detail.equals(chao.user.activity.signup_duplicate)) {
            prompt = "您已报名该活动";
        }//
        else if (detail.equals(chao.user.activity.checkin_location_required)) {
            prompt = "无法获取您的当前位置";
        }//
        else if (detail.equals(chao.user.subject.favorite_duplicate)) {
            prompt = "您已收藏该专题";
        }
        return prompt;
    }

    public static void prompt(Context context, String detail) {
        String msg = promptMsg(detail);
        if (TextUtils.isEmpty(msg))
            return;
        if (context == null)
            return;
        Toast.makeText(context, msg, 300).show();
    }

}
